home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3x / cpusetGetCPUCount.z / cpusetGetCPUCount
Encoding:
Text File  |  2001-04-17  |  2.6 KB  |  67 lines

  1.  
  2.  
  3.  
  4. ccccppppuuuusssseeeettttGGGGeeeettttCCCCPPPPUUUUCCCCoooouuuunnnntttt((((3333xxxx))))                                    ccccppppuuuusssseeeettttGGGGeeeettttCCCCPPPPUUUUCCCCoooouuuunnnntttt((((3333xxxx))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      cpusetGetCPUCount - obtain the number of CPUs configured on the system
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ccccppppuuuusssseeeetttt....hhhh>>>>
  13.  
  14.      iiiinnnntttt ccccppppuuuusssseeeettttGGGGeeeettttCCCCPPPPUUUUCCCCoooouuuunnnntttt((((vvvvooooiiiidddd))));;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      The _c_p_u_s_e_t_G_e_t_C_P_U_C_o_u_n_t function returns the number of CPUs that are
  18.      configured on the system.
  19.  
  20. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  21.      This example obtains the number of CPUs configured on the system and then
  22.      prints out the result.
  23.  
  24.                int ncpus;
  25.  
  26.                if ( !(ncpus = cpusetGetCPUCount()) ) {
  27.                    perror("cpusetGetCPUCount");
  28.                    exit(1);
  29.                }
  30.                printf("The systems is configured for %d CPUs\n",
  31.                        ncpus);
  32.  
  33.  
  34. NNNNOOOOTTTTEEEESSSS
  35.      _c_p_u_s_e_t_G_e_t_C_P_U_C_o_u_n_t is found in the library "libcpuset.so", and will be
  36.      loaded if the option _----_llll_cccc_pppp_uuuu_ssss_eeee_tttt is used with _cccc_cccc(1) or _llll_dddd(1).
  37.  
  38. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  39.      cpuset(1), cpuset(5).
  40.  
  41. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  42.      If successful, _c_p_u_s_e_t_G_e_t_C_P_U_C_o_u_n_t returns a value greater than or equal to
  43.      1.  If _c_p_u_s_e_t_A_t_t_a_c_h fails, it returns the value 0 and eeeerrrrrrrrnnnnoooo is set to
  44.      indicate the error.  The values for eeeerrrrrrrrnnnnoooo include those values as set by
  45.      _s_y_s_m_p(2) and the following:
  46.  
  47.      EEEERRRRAAAANNNNGGGGEEEE
  48.           Number of CPUs configured on the system is not a value greater than
  49.           or equal to 1.
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.